﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 绘制圆和椭圆
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            Graphics g = e.Graphics;
            Pen pen = new Pen(Color.Black);
            g.DrawEllipse(pen, 20, 20, 50, 100);  //参数为外接矩形
            Rectangle a = new Rectangle(30, 30, 50, 50);
            g.DrawEllipse(pen, a);
        }
    }
}
